package com.dailyblue.example.springcloud.config.controller;

import com.dailyblue.example.springcloud.commons.util.JsonResult;
import com.dailyblue.example.springcloud.commons.util.ResultTool;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/first")
@RefreshScope
public class FirstController {
    @Value("${student.id}")
    private Integer id;
    @Value("${student.name}")
    private String name;
    @Value("${student.gender}")
    private Character gender;

    @GetMapping("/a")
    public JsonResult a() {
        return ResultTool.success("id:" + id + ",name:" + name + ",gender:" + gender);
    }
}
